<?php


namespace App\Transformers\System;


use App\Models\SystemAttachmentCategory;
use League\Fractal\TransformerAbstract;

class SystemAttachmentCategoryTransformer extends TransformerAbstract
{
    public function transform(SystemAttachmentCategory $data)
    {
        return [
            'id' => $data->id,
            'pid' => $data->pid ?? '',
            'name' => $data->name ?? '',
            'english_name' => $data->english_name ?? '',
            'created_at' => $data->created_at ? $data->created_at->format("Y-m-d H:i:s") : '',
            'updated_at' => $data->updated_at ? $data->updated_at->format("Y-m-d H:i:s") : '',
        ];
    }
}
